home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4849 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.5 KB

  1. Path: bln.sel.alcatel.de!news
  2. From: 1570sw <1570sw@setsk0.rpi.ses.alcatel.es>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Help Needed On Using Scroll Bars
  5. Date: Thu, 01 Feb 1996 12:14:55 -0800
  6. Organization: Alcatel SEL AG Berlin
  7. Message-ID: <31111F3F.2BDD@setsk0.rpi.ses.alcatel.es>
  8. References: <310FC02B.4C1C@geis.geis.com>
  9. NNTP-Posting-Host: setxa2.rpi.ses.alcatel.es
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0b5 (Win16; I)
  14.  
  15. westley wrote:
  16. > Hello,
  17. > (Borland 4.0)
  18. > I wish to use a Scroll Bar with my Pop-up Dialog Box.
  19. > The resource workshop creates one easy enough. The problem
  20. > is that the help and documetation leave you a little short
  21. > about how to communicate with it. There is doc on using
  22. > the TScrollbar class but nothing dealing with using
  23. > the Scrollbar created with the WS_VSROLLBAR attribute set
  24. > for a DLG.
  25. >                         Westley L. Hespeth
  26. >                         Westley@geis.geis.com
  27. >                         Speth Software
  28.  
  29.  
  30. You maigth use transfer buffers to communicate with objects in dialog 
  31. boxes in general. This is a littel tricky, but easy when you know who
  32. to do it. I suggest you to follow the next steps:
  33.  
  34. 1.- Create a transfer structure for every dialog box you want to 
  35. communicate with; for example:
  36.  
  37.     typedef struct {
  38.     
  39.     ...
  40.         scrollbartransfertype scroll
  41.     ...
  42.  
  43.     } T_TransferType;
  44.  
  45. I'm sorry, but I don't remember at this moment the type for transfering 
  46. data from a scroll bar, but you can consult the manual in the chapter
  47. on dialog boxes.
  48.  
  49. 2.- Create a class, derived from TDialogBox, for every dialog box you 
  50. want to handle, in which constructor you have to put:
  51.  
  52.     TMyDialogBox::TMyDialogBox (Twindow* parent, T_TransferType& tr_type)
  53.     :TDialogBox(parent)
  54.     {
  55.  
  56.        ...
  57.         new TScrollBar(SCROLL_ID);
  58.     ....
  59.     TransferBuffer = &tr_type;
  60.  
  61.     }
  62.  
  63. Where SCROLL_ID is the identifier for your scroll bar you have defined
  64. with the resource workshop.
  65.  
  66. 3.- In your parent window, you have to do the next:
  67.  
  68.     T_TransferType t_type;
  69.  
  70.     ...
  71.  
  72.     // Initilize the varibles in t_type to the values you want to
  73.     // appear by default in your dialog when created.
  74.  
  75.     new TMyDialogBox(this, t_type);
  76.  
  77.     // To read the values introduced in the box:
  78.     x = t_type.x
  79.     ...
  80.  
  81. Where x is the variable you want to store the values returned.
  82.  
  83. I hope this will help you; anyhow, if you need more information I could
  84. provide you with some examples.
  85.  
  86. heras@setsk0.rpi.ses.alcatel.es
  87.